package top.aicats.pattern.singleton.enumSingleton;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class EnumSingletonTest {
    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {

        EnumSingleton singleton = EnumSingleton.getInstance();
        singleton.SetData("dddd");
        System.out.println(singleton);

        Class clazz = EnumSingleton.class;
        Constructor c =clazz.getDeclaredConstructor(String.class,int.class);
        c.setAccessible(true);
        EnumSingleton single =(EnumSingleton)c.newInstance("Tom",666);
        System.out.println(single);
    }


}
